package com.cauli.file.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cauli.file.model.dto.file.DownloadFileDTO;
import com.cauli.file.model.dto.file.PreviewDTO;
import com.cauli.file.model.dto.file.UploadFileDTO;
import com.cauli.file.model.entity.FileEntity;
import com.cauli.file.model.vo.file.UploadFileVO;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author Cauli
 * @date 2023-03-20 12:00
 * @description 文件传输 服务类
 */
public interface FileTransferService extends IService<FileEntity> {

    UploadFileVO uploadFileSpeed(UploadFileDTO uploadFileDTO);

    void uploadFile(HttpServletRequest request, UploadFileDTO UploadFileDto, Long userId);

    void downloadFile(HttpServletResponse httpServletResponse, DownloadFileDTO downloadFileDTO);

    void downloadUserFileList(HttpServletResponse httpServletResponse, String filePath, String fileName, List<Long> userFileIds);

    void previewFile(HttpServletResponse httpServletResponse, PreviewDTO previewDTO);

    void previewPictureFile(HttpServletResponse httpServletResponse, PreviewDTO previewDTO);

    void deleteFile(FileEntity fileEntity);

    Long selectStorageSizeByUserId(Long userId);
}
